package com.mastercard.ganadores.util.conexion;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class conectar {
    
    public static Connection Abre( ) throws SQLException {
        
        String url = "jdbc:mysql://localhost:3306/masterca_master?autoReconnect=true" ;
        Connection conn = null ;
        
        try {
            
            Class.forName( "com.mysql.jdbc.Driver" ).newInstance( ) ;
            conn = DriverManager.getConnection(url,"masterca_codice4","c0d1ce4") ;            
            
        } catch ( Exception e ) {
            e.printStackTrace( ) ;
        }
        
        return conn ;
        
    }
    
    public static void Cierra( Connection conn ) throws SQLException {
        conn.close( ) ;
    }
    
    private conectar( ) {
        
    }
    
}
